﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_Title.aspx.cs" Inherits="Admin_Admin_Title" %>

<%@ Register Assembly="XControl" Namespace="XControl" TagPrefix="XCL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>无标题页</title>
</head>
<body>
	<form id="form1" runat="server">
	<div>
		<asp:HyperLink ID="HyperLink2" runat="server" 
			NavigateUrl="Admin_Article.aspx?Act=Add">添加文章</asp:HyperLink>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<asp:Label ID="Label1" runat="server" Text="标题/作者："></asp:Label>
		<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
		<asp:Button ID="Button1" runat="server" Text="查询" />
		<XCL:XGridView ID="XGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
			DataKeyNames="ID" DataSourceID="ObjectDataSource1" AllowSorting="True">
			<Columns>
				<asp:TemplateField HeaderText="编号" SortExpression="ID">
					<ItemTemplate>
						<asp:LinkButton ID="IDLinkButton1" runat="server" CausesValidation="False" CommandName="Select"
							Text='<%# Eval("ID") %>'></asp:LinkButton>
					</ItemTemplate>
					<HeaderStyle CssClass="IntHead"></HeaderStyle>
					<ItemStyle CssClass="IntItem"></ItemStyle>
				</asp:TemplateField>
				<asp:TemplateField HeaderText="标题" SortExpression="TitleName">
					<EditItemTemplate>
						<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TitleName") %>'></asp:TextBox>
					</EditItemTemplate>
					<ItemTemplate>
						<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID", "Admin_Article.aspx?TitleID={0}") %>'
							Text='<%# Eval("TitleName") %>'></asp:HyperLink>
					</ItemTemplate>
					<HeaderStyle CssClass="TextHead" Width="400px"></HeaderStyle>
					<ItemStyle CssClass="TextItem"></ItemStyle>
				</asp:TemplateField>
				<asp:BoundField DataField="Author" HeaderText="作者" SortExpression="Author">
					<HeaderStyle CssClass="TextHead" Width="50px"></HeaderStyle>
					<ItemStyle CssClass="TextItem"></ItemStyle>
				</asp:BoundField>
				<asp:BoundField DataField="UserName" HeaderText="录入" SortExpression="UserName">
					<HeaderStyle CssClass="TextHead" Width="50px"></HeaderStyle>
					<ItemStyle CssClass="TextItem"></ItemStyle>
				</asp:BoundField>
				<asp:BoundField DataField="UpdateTime" HeaderText="更新时间" SortExpression="UpdateTime">
					<HeaderStyle CssClass="DateHead"></HeaderStyle>
					<ItemStyle CssClass="DateItem"></ItemStyle>
				</asp:BoundField>
				<asp:BoundField DataField="Hits" HeaderText="点击数" SortExpression="Hits">
					<HeaderStyle CssClass="IntHead"></HeaderStyle>
					<ItemStyle CssClass="IntItem"></ItemStyle>
				</asp:BoundField>
				<asp:CommandField ShowDeleteButton="True"></asp:CommandField>
			</Columns>
		</XCL:XGridView>
		<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="XCMSData.Title"
			DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="SelectAllByBoard"
			TypeName="XCMSData.Title" SelectCountMethod="SelectCountByBoard" 
            EnablePaging="True" SortParameterName="__order">
			<SelectParameters>
				<asp:QueryStringParameter Name="__ID" QueryStringField="BoardID" Type="Int32" />
				<asp:Parameter Name="__order" Type="String" />
				<asp:Parameter Name="startRowIndex" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="maximumRows" Type="Int32" DefaultValue="2000000" />
			</SelectParameters>
		</asp:ObjectDataSource>
	</div>
	</form>
</body>
</html>
